###
#Load Packages and Data
###

library(lfe) 
library(stargazer)

load('senate.supplement.mechanisms.RData')

###
#Relationship between DMA and Senate Roll Call Awareness
###

rollcall.correct <- felm( sen.correct  ~  state.dma.share +  factor(sen.party.alignment) + factor(gender) + factor(race) + factor(education) +  factor(income) + population.logged + female.share + black.share + under20.share + over65.share + log.density + log.median.household.income + share.11.education + share.12.education + share.more.education  | state.sen.year | 0 | state.sen.year,data=senate.supplement.mechanisms)
rollcall.dk <- felm( sen.dk  ~  state.dma.share +  factor(sen.party.alignment) + factor(gender) + factor(race) + factor(education) +  factor(income) + population.logged + female.share + black.share + under20.share + over65.share + log.density + log.median.household.income + share.11.education + share.12.education + share.more.education  | state.sen.year | 0 | state.sen.year,data=senate.supplement.mechanisms)
rollcall.wrong <- felm( sen.wrong  ~  state.dma.share +  factor(sen.party.alignment) + factor(gender) + factor(race) + factor(education) +  factor(income) + population.logged + female.share + black.share + under20.share + over65.share + log.density + log.median.household.income + share.11.education + share.12.education + share.more.education | state.sen.year | 0 | state.sen.year,data=senate.supplement.mechanisms)

#Table C2 - Appendix
stargazer(rollcall.correct,rollcall.wrong,rollcall.dk,keep=c('dma.share'),column.labels=c("Correct","Incorrect","Don't Know"),covariate.labels=c('DMA Share'),notes=c('State Fixed Effects','Individual and County Controls','Robust Standard Errors, Clustered by State'),star.cutoffs=c(0.05),notes.align='l',digits=2)
